const qsort = ([x, ...xs]) =>
  x === undefined
    ? []
    : [
      ...qsort(xs.filter(v => v < x)),
      x,
      ...qsort(xs.filter(v => v >= x))
    ];